<div class="page-title clearfix">
  <div class="title">矿机管理</div>
  <button nz-button class="fr btn-green" [routerLink]="routerLinks.minerItem.add" title="添加"><i
    class="anticon anticon-plus"></i>
    添加
  </button>
</div>

<div class="panel">
  <nz-table #nzTable
            [nzData]="minerItemList.voList"
            [nzLoading]="_loading"
            [nzFrontPagination]="false"
            [nzShowTotal]="totalRow"
            [nzPageSize]="minerItemList.pageSize"
            [nzTotal]="minerItemList.totalRow"
            [nzPageIndex]="minerItemList.curPage"
            (nzPageIndexChange)="queryMinerItemList($event)">
    <thead nz-thead>
    <ng-template #totalRow>共 {{minerItemList.totalRow}} 条数据</ng-template>
    <tr>
      <th nz-th class="text-center" nzWidth="5%"><span>序号</span></th><!--序号-->
      <th nz-th class="text-center" nzWidth="7%"><span>价格</span></th><!--价格-->
      <th nz-th class="text-center" nzWidth="8%"><span>日收益(JLB)</span></th><!--日收益-->
      <th nz-th class="text-center" nzWidth="8%"><span>算力(GH)</span></th><!--算力-->
      <th nz-th class="text-center" nzWidth="8%"><span>挖矿上限(JLB)</span></th><!--挖矿上限-->
      <th nz-th class="text-center" nzWidth="8%"><span>上限倍数(倍)</span></th><!--上限倍数-->
      <th nz-th class="text-center" nzWidth="18%"><span>支付方式</span></th><!--上限倍数-->
      <th nz-th class="text-center" nzWidth="8%"><span>库存</span></th><!--上限倍数-->
      <th nz-th class="text-center" nzWidth="8%"><span>商城分割量</span></th><!--上限倍数-->
      <th nz-th class="text-center" nzWidth="7%"><span>需要激活币</span></th><!--需要激活币-->
      <th nz-th class="text-center" nzWidth="8%"><span>状态</span></th><!--状态：待上架 Audit，销售中 Sales，已下架 Withdraw-->
      <th nz-th class="text-center" nzWidth="7%"><span>操作</span></th><!--操作-->
    </tr>
    </thead>
    <tbody nz-tbody>
    <ng-template ngFor let-data [ngForOf]="nzTable.data" let-i="index">
      <tr nz-tbody-tr>
        <td nz-td class="text-center">{{i+1}}</td>
        <td nz-td class="text-center">{{data.price | number}}</td>
        <td nz-td class="text-center">{{data.dailyIncome | number}} JLB</td>
        <td nz-td class="text-center">{{data.power}}</td>
        <td nz-td class="text-center">{{data.upperLimit | number}} JLB</td>
        <td nz-td class="text-center">{{data.multiple | number}} 倍</td>
        <td nz-td class="text-center font12">
          金兰宝:{{data.jlb}} JLB <br/>
          金兰宝+矿石: {{data.mixJlb}} JLB + {{data.mixOre}} 矿石
        </td>
        <td nz-td class="text-center">{{data.inventory | number}}</td>
        <td nz-td class="text-center">{{data.separateLimit | number}}</td>
        <td nz-td class="text-center">
          <span [ngClass]="{'color-orange': data.isActiveCoin === yesOrNo.yes,
          'color-blue': data.isActiveCoin === yesOrNo.no}">
            {{data.isActiveCoin | enumName:isActiveCoin}}</span>
        </td>
        <td nz-td class="text-center">
          <nz-badge nzStatus="processing" *ngIf="data.state === minerStates.sales"></nz-badge>
          <nz-badge nzStatus="default" *ngIf="data.state === minerStates.withdraw"></nz-badge>
          <nz-badge nzStatus="warning" *ngIf="data.state === minerStates.audit"></nz-badge>
          {{data.state | enumName:states}}
        </td>
        <td nz-td class="text-center">
          <button nz-button class="btn-blue-o mr" [routerLink]="[routerLinks.minerItem.modify,data.code]"
                  title="修改">
            <i class="anticon anticon-edit"></i></button>
        </td>
      </tr>
    </ng-template>
    </tbody>
  </nz-table>
</div>
